<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich">

<body>
	<ui:composition template="/template/template.xhtml">
		
		<ui:define name="body">
		
			<rich:panel header="Command">				
			
				<h:form>

					<h:panelGrid columns="3">
		                <h:outputText value="Nid:" />
		                <h:inputText value="#{commandBean.nid}" id="nid" label="nid">
		                    <f:validateLength minimum="2" maximum="3" />
		                    <f:validateRequired />
		                    <rich:validator />
		                </h:inputText>
		                <rich:message for="nid" />
		               
		                <h:outputText value="On/Off:" />
		                <h:inputText value="#{commandBean.onOff}" id="onOff" label="onOff">
		                    <f:validateLength minimum="0" maximum="2" />
		                    <f:validateRequired />
		                    <rich:validator />
		                </h:inputText>
		                <rich:message for="onOff" />

		                <h:outputText value="Fan Speed:" />
		                <h:inputText value="#{commandBean.fanSpeed}" id="fanSpeed" label="fanSpeed">
		                    <f:validateLength minimum="0" maximum="2" />
		                    <f:validateRequired />
		                    <rich:validator />
		                </h:inputText>
		                <rich:message for="fanSpeed" />		                 
		                
		                <h:outputText value="Room Temperature:" />
		                <h:inputText value="#{commandBean.roomTemp}" id="roomTemp" label="roomTemp">
		                	<!-- f:convertNumber type="number" pattern="#" integerOnly="true" maxIntegerDigits="2"/-->
		                    <f:validateLength minimum="0" maximum="2" />
		                    <f:validateRequired />
		                    <rich:validator />
		                </h:inputText>
		                <rich:message for="roomTemp" />	
		                
		                <!--
		               
		                <h:outputText value="Gate Temperature:" />
		                <h:inputText value="#{commandBean.gateTemp}" id="gateTemp" label="gateTemp">
		                    <f:validateLength minimum="1" maximum="2" />
		                    <f:validateRequired />
		                    <rich:validator />
		                </h:inputText>
		                <rich:message for="gateTemp" />
		                
		                <h:outputText value="Default Temperature:" />
		                <h:inputText value="#{commandBean.defaultTemp}" id="defaultTemp" label="defaultTemp">
		                    <f:validateLength minimum="1" maximum="2" />
		                    <f:validateRequired />
		                    <rich:validator />
		                </h:inputText>
		                <rich:message for="defaultTemp" />	
		                
		                <h:outputText value="Door:" />
		                <h:inputText value="#{commandBean.door}" id="door" label="door">
		                    <f:validateLength minimum="1" maximum="4" />
		                    <f:validateRequired />
		                    <rich:validator />
		                </h:inputText>
		                <rich:message for="door" />
		                		                
		                <h:outputText value="Minimum Temperature:" />
		                <h:inputText value="#{commandBean.minTemp}" id="minTemp" label="minTemp">
		                    <f:validateLength minimum="1" maximum="3" />
		                    <f:validateRequired />
		                    <rich:validator />
		                </h:inputText>
		                <rich:message for="minTemp" />		                
		                
		                <h:outputText value="Lock:" />
		                <h:inputText value="#{commandBean.lock}" id="lock" label="lock">
		                    <f:validateLength minimum="1" maximum="2" />
		                    <f:validateRequired />
		                    <rich:validator />
		                </h:inputText>
		                <rich:message for="lock" />	
		                
		                <h:outputText value="Status:" />
		                <h:inputText value="#{commandBean.status}" id="status" label="status">
		                    <f:validateLength minimum="1" maximum="2" />
		                    <f:validateRequired />
		                    <rich:validator />
		                </h:inputText>
		                <rich:message for="status" />			                
		                
		                -->

		            </h:panelGrid>
					<h:commandButton id="submitbtn" value="submit" action="#{commandBean.placeCommand}" />
				
				</h:form>
				
			</rich:panel>
			

			
			
			
		</ui:define>
	</ui:composition>
</body>
</html>
